/**
 *  1 获取用户基本信息
 *  2 更新用户基本信息
 *  3 重置密码
 *  4 更新用户头像
 */
const express = require('express')
const router = express.Router()
const expressJoi = require('@escook/express-joi')

const userinfoHandler = require('../routers_handler/userinfo_handler')
const reg_user_schema = require('../schema/user')


// 获取用户基本信息路由
router.get('/getUserInfo', expressJoi(reg_user_schema.getUserInfo), userinfoHandler.getUserInfo)


// 更新用户基本信息路由
router.post('/updateUserInfo', expressJoi(reg_user_schema.updateUserInfo), userinfoHandler.updateUserInfo)


// 重置密码路由
router.post('/resetPassword', expressJoi(reg_user_schema.resetPassword), userinfoHandler.resetPassword)


// 更新用户头像路由
router.post('/updateAvatar', expressJoi(reg_user_schema.updateAvatar), userinfoHandler.updateAvatar)


module.exports = router